// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod commands;
mod models;
mod parser;
mod state;

use state::AppState;

fn main() {
    tauri::Builder::default()
        .manage(AppState::default())
        .setup(|app| {
            Ok(())
        })
        .invoke_handler(tauri::generate_handler![
            commands::load_sample_words,
            commands::parse_file_content,
            commands::update_config,
            commands::get_current_word,
            commands::speak_word,
            commands::next_word,
            commands::prev_word,
            commands::set_current_index,
            commands::get_progress,
            commands::reset_dictation,
            commands::set_playing
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}